import java.util.Arrays;

/**
 * @Author 12629
 * @Description：
 */
class Student {
    public String name;
    public int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
public class Test {

    public static void main(String[] args) {
        final int[] array = {1,2,3,4,5};

        //array = new int[]{9,8,7,6,5};

        array[0] = 99;    /**/


    }

    public static void main16(String[] args) {
        String str = "   abc d ef  f     ";
        String ret = str.trim();
        System.out.println(str);
        System.out.println(ret);
    }

    public static void main15(String[] args) {
        String str = "abcdef";
        String ret2 = str.substring(0);
        String ret = str.substring(0,str.length()); //[2,4)
        System.out.println(ret);
    }

    public static void main14(String[] args) {
        /*String str = "name=zhangsan=haha=1234";
        String[] ret = str.split("=",2);
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }*/

       /* String str = "192.168.1.1";
        String[] ret = str.split("\\.");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }*/


       /* String str = "abc\\def\\ghk";
        String[] ret = str.split("\\\\");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }*/

        /*String str = "name=zhagnsan&age=10";
        String[] ret = str.split("=|&");
        for (int i = 0; i < ret.length; i++) {
            System.out.println(ret[i]);
        }*/

        String str = "name=zhagnsan&age=10";
        String[] ret = str.split("&");
        for (String x : ret ) {
            //System.out.println(ret[i]);
            String[] ss = x.split("=");
            for(String xx : ss) {
                System.out.println(xx);
            }
        }

    }

    public static void main13(String[] args) {
        String str = "ababcabcdabcdeabcdef";

        //String ret = str.replace('a','k');
        //String ret = str.replace("ab","klp");
        //String ret = str.replaceFirst("ab","klp");
        String ret = str.replaceAll("ab","klp");

        System.out.println(str);
        System.out.println(ret);

    }

    public static void main12(String[] args) {
        String str = "abcdef";
        char[] value = str.toCharArray();
        System.out.println(Arrays.toString(value));

        String ret = String.format("%d-%d-%d",2008,9,1);
        System.out.println(ret);
    }

    public static void main11(String[] args) {
        String str1= "AbcD";
        //String ret = str1.toUpperCase();
        String ret = str1.toLowerCase();
        System.out.println(str1);
        System.out.println(ret);
    }

    public static void main10(String[] args) {
        String str1 = String.valueOf(123);
        String str2= String.valueOf(123.4);
        System.out.println(str1);
        System.out.println(str2);
        Student student = new Student("bit",10);
        String str3= String.valueOf(student);
        System.out.println(str3);
        System.out.println(student);

        int a = Integer.parseInt("1234");
        System.out.println(a+1);

        double b = Double.parseDouble("12.34");
        System.out.println(b);


    }


    public static void main9(String[] args) {
        String str1= "ababcabcdabcde";
        //从后往前找
        int index = str1.lastIndexOf('a');
        System.out.println(index);

        //从指定下标 开始 往前找  遇到对应的字符串 停止
        index = str1.lastIndexOf('a',3);
        System.out.println(index);

    }

    public static void main8(String[] args) {
        String str1= "ababcabcdabcde";
        //从后往前找
        int index = str1.lastIndexOf("abc");
        System.out.println(index);

        //从指定下标 开始 往前找  遇到对应的字符串 停止
        index = str1.lastIndexOf("abc",3);
        System.out.println(index);

    }

    public static void main7(String[] args) {
        String str1= "acbcdecf";
        //返回第一次遇到的1
        int index = str1.indexOf("bcd");
        System.out.println(index);


        //在字符串当中 从2下标开始，找到字符c的位置
        index = str1.indexOf("bcd",3);
        System.out.println(index);

    }

    public static void main6(String[] args) {
        String str1= "acbcdecf";
        /*char ch = str1.charAt(1);
        System.out.println(ch);*/
        //返回第一次遇到的1
        int index = str1.indexOf('c');
        System.out.println(index);
        //在字符串当中 从2下标开始，找到字符c的位置
        index = str1.indexOf('c',2);
        System.out.println(index);

    }
    public static void main5(String[] args) {
        String str1= "Abcdef";
        String str2 = "abcdef";
        System.out.println(str1.compareTo(str2));
        //System.out.println(str1.equalsIgnoreCase(str2));
        System.out.println(str1.compareToIgnoreCase(str2));
    }

    public static void func(String str) {
        System.out.println(str);
    }

    public static void main4(String[] args) {
        String s = "abdcef";
        func(s);
    }

    public static void main3(String[] args) {
        String s = "abdcef";
        //System.out.println(s.length());

        //String s2 = "";
        String s2 = null;
        System.out.println(s2.length());

        System.out.println(s2.isEmpty());



    }
    public static void main2(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        String s3 = s1;

        System.out.println(s1.equals(s2));

        /*System.out.println(s3);
        System.out.println(s1);
        System.out.println(s2);*/

    }
    public static void main1(String[] args) {
        String str = "abcdef";
        System.out.println(str);


        String str2 = new String("hello");
        System.out.println(str2);

        char[] value = {'b','i','t'};
        String str3 = new String(value);




        /*int[] array1 = {1,2,3,4};
        int[] array2 = new int[]{1,2,3,4};*/

    }
}
